<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <title>角色管理</title>
    <link rel="stylesheet" href="http://static-online.zhaogangtest.com/publicresource/css/bootstrap-table.css">
    <link rel="stylesheet" href="../../../resources/public/css/bootstrap-table-fixed-columns.css">
    <link rel="stylesheet" href="http://static-online.zhaogangtest.com/publicresource/control/daterangpicker/daterangepicker-bs3.css">
    <link rel="stylesheet" href="../../../resources/public/css/table.css">
    <link rel="stylesheet" href="http://static-online.zhaogangtest.com/publicresource/css/zTreeStyle.css">
    <link rel="stylesheet" href="../../../resources/public/css/iconfont.min.css">
    <link rel="stylesheet" href="../../../resources/public/css/scmstrap.css">
</head>

<body>
    <div class="main">
        <!-- 条件区域 -->
        <div class="form-list">
            <div class="group">
                <label>角色名称</label>
                <div class="scm-input-wrap">
                    <input type="text" class="scm-input">
                </div>
            </div>
        </div>
        <!-- 按钮 -->
        <div class="operation">
            <div class="conditionbtn">
                <button class="scm-btn blue">
                    <i class="anticon icon-search1"></i>查询</button>
                <button class="scm-btn">
                    <i class="anticon icon-retweet"></i>重置</button>
            </div>
            <div class="scm-btn-group fr">
                <button class="scm-btn btn-add-item">
                    <i class="anticon icon-plus"></i>添加
                </button>
                <button class="scm-btn btn-adjust-item">
                    <i class="anticon icon-edit1"></i>修改
                </button>
                <button class="scm-btn btn-authority">
                    <i class="anticon icon-key"></i>权限
                </button>
                <button class="scm-btn btn-user">
                    <i class="anticon icon-user"></i>用户
                </button>
                <button class="scm-btn btn-warehouse">
                    <i class="anticon icon-isv"></i>对应仓库
                </button>
                <button class="scm-btn btn-workshop">
                    <i class="anticon icon-isv"></i>对应车间
                </button>
                <button class="scm-btn btn-department">
                    <i class="anticon icon-isv"></i>部门关联
                </button>
            </div>
        </div>
        <div class="box-table">
            <table class="table table-condensed" id="table-parent"></table>
        </div>
    </div>
    <!-- 添加 -->
    <div class="layer-add-item" style="display: none;">
        <div class="main">
            <!-- 条件区域 -->
            <div class="form-list form-list-btn-inner nofloat">
                <div class="group group-double-column-style ">
                    <label>角色名称：</label>
                    <div class="scm-input-wrap">
                        <input type="text" class="scm-input">
                    </div>
                </div>
                <div class="group group-double-column-style">
                    <label>状态：</label>
                    <div class="scm-input-wrap mycheckradioall">
                        <label class="mycheckradio radio-popup-style"><em></em>禁用</label>
                        <label class="mycheckradio radio-popup-style active"><em></em>启用</label>
                    </div>
                </div>
                <div class="group group-double-column-style ">
                    <label><b class="must">*</b>备注：</label>
                    <div class="scm-input-wrap">
                        <textarea type="text" class="scm-input"></textarea>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- 修改 -->
    <div class="layer-adjust-item" style="display: none;">
        <div class="main">
            <!-- 条件区域 -->
            <div class="form-list form-list-btn-inner nofloat">
                <div class="group group-double-column-style ">
                    <label>角色名称：</label>
                    <div class="scm-input-wrap">
                        <input type="text" class="scm-input" value="管理员">
                    </div>
                </div>
                <div class="group group-double-column-style">
                    <label>状态：</label>
                    <div class="scm-input-wrap mycheckradioall">
                        <label class="mycheckradio radio-popup-style"><em></em>禁用</label>
                        <label class="mycheckradio radio-popup-style active"><em></em>启用</label>
                    </div>
                </div>
                <div class="group group-double-column-style ">
                    <label>备注：</label>
                    <div class="scm-input-wrap">
                        <textarea type="text" class="scm-input">管理员</textarea>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- 权限 -->
    <div class="layer-authority" style="display: none;">
        <div class="main">
            <div class="operation">
                <div class="conditionbtn">
                    <button class="scm-btn">
                        <i class="anticon icon-isv"></i>全选</button>
                    <button class="scm-btn">
                        <i class="anticon icon-isv"></i>取消全选</button>
                </div>
            </div>
            <div class="form-list form-list-more speical-search-style nofloat">
                <div class="group double-column-input-style popup-multiple-checkbox-style">
                    <label>销售SKU属性</label>
                    <div class="scm-input-wrap" style="margin-bottom: 7px;">
                        <label class="mycheckbox "><em></em>品名</label>
                        <label class="mycheckbox "><em></em>材质</label>
                        <label class="mycheckbox "><em></em>标准</label>
                        <label class="mycheckbox "><em></em>规格</label>
                        <label class="mycheckbox "><em></em>品质</label>
                        <label class="mycheckbox "><em></em>计量方式</label>
                        <label class="mycheckbox "><em></em>交货状态</label>
                        <label class="mycheckbox "><em></em>厚度</label>
                        <label class="mycheckbox "><em></em>宽度</label>
                        <label class="mycheckbox "><em></em>长度</label>
                        <label class="mycheckbox "><em></em>是否定尺</label>
                        <label class="mycheckbox "><em></em>件支数</label>
                        <label class="mycheckbox "><em></em>产品类型</label>
                    </div>
                </div>
            </div>
            <!-- 按钮 -->
            <div class="special-search-detail">
                <div class="title">绑定维护销售员</div>
                <ul class="ztree" id="treedeo"></ul>
            </div>
        </div>
    </div>
    <!-- 用户 -->
    <div class="layer-user" style="display: none;">
        <div class="main">
            <div class="operation">
                <div class="conditionbtn">
                    <button class="scm-btn">
                        <i class="anticon icon-isv"></i>全选</button>
                    <button class="scm-btn">
                        <i class="anticon icon-isv"></i>取消全选</button>
                </div>
            </div>
            <div class="form-list form-list-more speical-search-style nofloat">
                <div class="group double-column-input-style popup-multiple-checkbox-style">
                    <label>销售SKU属性</label>
                    <div class="scm-input-wrap" style="margin-bottom: 7px;">
                        <label class="mycheckbox "><em></em>品名</label>
                        <label class="mycheckbox "><em></em>材质</label>
                        <label class="mycheckbox "><em></em>标准</label>
                        <label class="mycheckbox "><em></em>规格</label>
                        <label class="mycheckbox "><em></em>品质</label>
                        <label class="mycheckbox "><em></em>计量方式</label>
                        <label class="mycheckbox "><em></em>交货状态</label>
                        <label class="mycheckbox "><em></em>厚度</label>
                        <label class="mycheckbox "><em></em>宽度</label>
                        <label class="mycheckbox "><em></em>长度</label>
                        <label class="mycheckbox "><em></em>是否定尺</label>
                        <label class="mycheckbox "><em></em>件支数</label>
                        <label class="mycheckbox "><em></em>产品类型</label>
                    </div>
                </div>
            </div>
            <!-- 按钮 -->
            <div class="special-search-detail">
                <div class="title">绑定维护销售员</div>
                <ul class="ztree" id="treedeo2"></ul>
            </div>
        </div>
    </div>
    <!-- 对应仓库 -->
    <div class="layer-warehouse" style="display: none;">
        <div class="main">
            <!-- 条件区域 -->
            <div class="form-list form-list-btn-inner nofloat">
                 <div class="form-list  nofloat nofloat-multiple-checkbox">
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>销售部</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>中板下线点</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>中板计划科</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>测试部</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>中板发货处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>中板统计</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>中板生产部</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>常州办事处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>无锡办事处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>江阴办事处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>南华办事处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>财务科</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>杭州办事处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>宁波办事处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>台州办事处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>螺纹发货处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>螺纹统计科</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>螺纹生产部</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>螺纹质检科</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>长达企管部</label>
                </div>
            </div>
            </div>
        </div>
    </div>
    <!-- 对应车间 -->
    <div class="layer-workshop" style="display: none;">
        <div class="main">
            <!-- 条件区域 -->
            <div class="form-list form-list-btn-inner nofloat">
                 <div class="form-list  nofloat nofloat-multiple-checkbox">
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>高一车间</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>中板车间-切边板</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>中班车间-毛边板</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>中班车件-火切</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>中板车间-贴牌</label>
                </div>
            </div>
            </div>
        </div>
    </div>
    <!-- 部门关联 -->
    <div class="layer-department" style="display: none;">
        <div class="main">
            <!-- 条件区域 -->
            <div class="form-list form-list-btn-inner nofloat">
                 <div class="form-list  nofloat nofloat-multiple-checkbox">
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>销售部</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>中板下线点</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>中板计划科</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>测试部</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>中板发货处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>中板统计</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>中板生产部</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>常州办事处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>无锡办事处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>江阴办事处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>南华办事处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>财务科</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>杭州办事处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>宁波办事处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>台州办事处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>螺纹发货处</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>螺纹统计科</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>螺纹生产部</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>螺纹质检科</label>
                </div>
                <div class="group group-multiple-checkbox">
                    <label class="mycheckbox multiple-checkbox"><em></em>长达企管部</label>
                </div>
            </div>
            </div>
        </div>
    </div>
    <script src="http://static-online.zhaogangtest.com/publicresource/js/require.js"></script>
    <script>
    var page;

    require.config({
        paths: {
            "jquery": "../../../resources/public/js/jquery.min",
            "bootstrap": 'http://static-online.zhaogangtest.com/publicresource/js/bootstrap.min',
            // "bootstrap-table": "http://static-online.zhaogangtest.com/publicresource/js/bootstrap-table",
            "bootstrap-table": "../../../resources/public/js/bootstrap-table",
            "moment": "http://static-online.zhaogangtest.com/publicresource/control/daterangpicker/moment.min",
            "daterangepicker": "../../../resources/public/js/daterangepicker",
            "ztreecore": "http://static-online.zhaogangtest.com/publicresource/js/jquery.ztree.core.min",
            "ztreeexcheck": "http://static-online.zhaogangtest.com/publicresource/js/jquery.ztree.excheck.min",

            "layer": 'http://static-online.zhaogangtest.com/publicresource/control/layer/layer.min',
            "public": "../../../resources/public/js/public",
            "chinese": "../../../resources/public/js/chinese",
            "bootstrap-table-fixed": "../../../resources/public/js/bootstrap-table-fixed-columns",
            "autocomplete": "../../../resources/public/js/jquery.autocomplete",
        },
        shim: {
            "jquery": {
                exports: ['jQuery', '$']
            },
            "bootstrap": {
                deps: ["jquery"]
            },
            "bootstrap-table": {
                deps: ["jquery", "bootstrap"]
            },
            "bootstrap-table-fixed": {
                deps: ["bootstrap-table"]
            },
            "layer": {
                deps: ["jquery"],
                exports: "layer"
            },
            "ztreecore": {
                deps: ["jquery"],
            },
            "ztreeexcheck": {
                deps: ["jquery", "ztreecore"],
            },
            "autocomplete": {
                deps: ['jquery']
            },
            "moment": {
                deps: ['jquery']
            },
            "daterangepicker": {
                deps: ["jquery", "moment"],
                exports: "daterangepicker"
            },
            "chinese": {
                deps: ["jquery", "bootstrap-table"],
            },

            "public": {
                deps: ["jquery", "bootstrap-table", "moment", "daterangepicker"]
            }
        }
    });
    require(["autocomplete", "ztreecore", "ztreeexcheck", "public", "layer", "chinese", "bootstrap-table-fixed"], function() {
        layer.config({
            path: 'http://static-online.zhaogangtest.com/publicresource/control/layer/'
        });
        $(function() {
            page = {
                init: function() {
                    this.bootstrapTable();
                    this.autocomplete();
                    this.fn_layer();
                    this.ztree();

                    var that = this;
                    $(window).resize(function() {
                        $('#table-parent').bootstrapTable('resetView', {
                            height: that.getHeight()
                        });
                        $('.daterangepicker').hide()
                    });
                    $.daterangepicker("#datepicker", {
                        singleDatePicker: false,
                    });

                },
                bootstrapTable: function() {
                    $('#table-parent').bootstrapTable({
                        pagination: true, //在表格底部显示分页工具栏
                        pageSize: 50,
                        pageNumber: 1,
                        pageList: [10, 25, 50, 100],
                        height: page.getHeight(),
                        showFooter: true,
                        showColumns: false,
                        showRefresh: false,
                        //                    showToggle:true,
                        search: false,
                        //                    showPaginationSwitch:true,
                        //    detailView: true,
                        //   detailFormatter: page.showdetail,
                        // detailFormatter: this.showChild,
                        // onExpandRow: this.expandRow,
                        // onCollapseRow: this.collapseRow,
                        locales: 'zh-CN',
                        fixedColumns: false,
                        fixedNumber: 1,
                        url: '../data/erp/tablelist-character-manage.json',
                        sidePagination: "server", //分页方式：client客户端分页，server服务端分页（*）

                        columns: [{
                            "field": "n1",
                            "title": "角色名称",
                        }, {
                            "field": "n2",
                            "title": "状态",
                        }, {
                            "field": "n3",
                            "title": "备注",
                        }, {
                            "field": "n4",
                            "title": "用户列表",
                        }]
                    });
                },

                fn_layer: function() {
                    //添加
                    $(document).on('click', '.btn-add-item', function() {
                        layer.open({
                            type: 1, //page层
                            area: ['600px', '270px'],
                            title: '添加',
                            shadeClose: false,
                            btn: ['确定', '取消'],
                            shade: 0.01, //遮罩透明度
                            moveType: 1, //拖拽风格，0是默认，1是传统拖动
                            shift: -1, //0-6的动画形式，-1不开启
                            content: $('.layer-add-item'),
                            skin: "skin-searchMore skin-overflow",
                            yes: function() {}
                        });
                    })
                    //修改
                    $(document).on('click', '.btn-adjust-item', function() {
                        layer.open({
                            type: 1, //page层
                            area: ['600px', '270px'],
                            title: '修改',
                            shadeClose: false,
                            btn: ['确定', '取消'],
                            shade: 0.01, //遮罩透明度
                            moveType: 1, //拖拽风格，0是默认，1是传统拖动
                            shift: -1, //0-6的动画形式，-1不开启
                            content: $('.layer-adjust-item'),
                            skin: "skin-searchMore skin-overflow",
                            yes: function() {}
                        });
                    })
                    //权限
                    $(document).on('click', '.btn-authority', function() {
                        layer.open({
                            type: 1, //page层
                            area: ['730px', 'auto'],
                            title: '权限分配（管理员）',
                            shadeClose: false,
                            btn: ['确定', '取消'],
                            shade: 0.01, //遮罩透明度
                            moveType: 1, //拖拽风格，0是默认，1是传统拖动
                            shift: -1, //0-6的动画形式，-1不开启
                            content: $('.layer-authority'),
                            skin: "skin-searchMore",
                            yes: function() {}
                        });
                    })
                    //用户
                    $(document).on('click', '.btn-user', function() {
                        layer.open({
                            type: 1, //page层
                            area: ['730px', 'auto'],
                            title: '选择用户',
                            shadeClose: false,
                            btn: ['确定', '取消'],
                            shade: 0.01, //遮罩透明度
                            moveType: 1, //拖拽风格，0是默认，1是传统拖动
                            shift: -1, //0-6的动画形式，-1不开启
                            content: $('.layer-user'),
                            skin: "skin-searchMore",
                            yes: function() {}
                        });
                    })
                     //对应仓库
                    $(document).on('click', '.btn-warehouse', function() {
                        layer.open({
                            type: 1, //page层
                            area: ['730px', 'auto'],
                            title: '仓库选择',
                            shadeClose: false,
                            btn: ['确定', '取消'],
                            shade: 0.01, //遮罩透明度
                            moveType: 1, //拖拽风格，0是默认，1是传统拖动
                            shift: -1, //0-6的动画形式，-1不开启
                            content: $('.layer-warehouse'),
                            skin: "skin-searchMore",
                            yes: function() {}
                        });
                    })
                    //对应车间
                    $(document).on('click', '.btn-workshop', function() {
                        layer.open({
                            type: 1, //page层
                            area: ['730px', 'auto'],
                            title: '车间选择',
                            shadeClose: false,
                            btn: ['确定', '取消'],
                            shade: 0.01, //遮罩透明度
                            moveType: 1, //拖拽风格，0是默认，1是传统拖动
                            shift: -1, //0-6的动画形式，-1不开启
                            content: $('.layer-workshop'),
                            skin: "skin-searchMore",
                            yes: function() {}
                        });
                    })
                    //部门关联
                    $(document).on('click', '.btn-department', function() {
                        layer.open({
                            type: 1, //page层
                            area: ['730px', 'auto'],
                            title: '部门选择',
                            shadeClose: false,
                            btn: ['确定', '取消'],
                            shade: 0.01, //遮罩透明度
                            moveType: 1, //拖拽风格，0是默认，1是传统拖动
                            shift: -1, //0-6的动画形式，-1不开启
                            content: $('.layer-department'),
                            skin: "skin-searchMore",
                            yes: function() {}
                        });
                    })
                },

                ztree: function() {
                    var setting = {
                        view: {
                            showLine: false,
                            showIcon: false,
                            fontCss: getFontCss
                        },
                        check: {
                            enable: true,
                            chkboxType: {
                                "Y": "ps",
                                "N": "ps"
                            }
                        }
                        // check: {
                        //     enable: true,
                        //     chkStyle: "radio",
                        //     radioType: "all"
                        // }
                    };
                    var zNodes = [{
                            name: "ERP",
                            // open: true,
                            children: [{
                                name: '库存管理'
                            }, {
                                name: '销售管理'
                            }, {
                                name: '分站销售管理'
                            }, {
                                name: '结算管理'
                            }, {
                                name: '报表统计'
                            }, {
                                name: '基础设置'
                            }, {
                                name: '系统设置'
                            }, {
                                name: '转运管理'
                            }, {
                                name: '在线平台管理'
                            }]
                        }, {
                            name: "WMS",
                            children: [{
                                name: '生产计划',
                                children: [{
                                    name: '子节点211'
                                }, {
                                    name: '子节点212'
                                }, {
                                    name: '子节点213'
                                }, {
                                    name: '父节点211',
                                    children: [{
                                        name: '子节点2111'
                                    }, {
                                        name: '子节点2112'
                                    }, {
                                        name: '子节点2113'
                                    }]
                                }]
                            }, {
                                name: '父节点22',
                                children: [{
                                    name: '子节点221'
                                }, {
                                    name: '子节点222'
                                }, {
                                    name: '子节点223'
                                }, {
                                    name: '父节点221',
                                    children: [{
                                            name: '子节点2211'
                                        }, {
                                            name: '子节点2212'
                                        }, {
                                            name: '子节点2213'
                                        }

                                    ]

                                }]
                            }],

                        }, {
                            name: "父节点3-无子节点",
                            isParent: true

                        }

                    ]



                    function focusKey(e) {

                        if (key.hasClass("empty")) {
                            key.removeClass("empty");
                        }
                    }

                    function blurKey(e) {
                        if (key.get(0).value === "") {
                            key.addClass("empty");
                        }
                    }
                    var lastValue = "",
                        nodeList = [];

                    function searchNode(e) {
                        var zTree = $.fn.zTree.getZTreeObj("treedeo1");
                        var zTree = $.fn.zTree.getZTreeObj("treedeo2");

                        var value = $.trim(key.get(0).value);
                        var keyType = "";
                        keyType = "name";
                        if (lastValue === value) return;
                        lastValue = value;
                        if (value === "") return;
                        updateNodes(false);
                        nodeList = zTree.getNodesByParamFuzzy(keyType, value);
                        updateNodes(true);

                    }

                    function updateNodes(highlight) {
                        var zTree = $.fn.zTree.getZTreeObj("treedeo1");
                        var zTree = $.fn.zTree.getZTreeObj("treedeo2");

                        for (var i = 0, l = nodeList.length; i < l; i++) {
                            nodeList[i].highlight = highlight;
                            zTree.updateNode(nodeList[i]);
                        }
                    }

                    function getFontCss(treeId, treeNode) {
                        return (!!treeNode.highlight) ? {
                            color: "#23527c",
                            "font-weight": "bold"
                        } : {
                            color: "#333",
                            "font-weight": "normal"
                        };
                    }
                    var key;
                    $(document).ready(function() {
                        $.fn.zTree.init($("#treedeo"), setting, zNodes);
                        $.fn.zTree.init($("#treedeo1"), setting, zNodes);
                        $.fn.zTree.init($("#treedeo2"), setting, zNodes);


                        key = $(".tree-search input");
                        key.bind("focus", focusKey)
                            .bind("blur", blurKey)
                        $(".tree-search button").bind("click", searchNode);
                    });
                },
                autocomplete: function() {
                    var data = ['上海钢找塑料', '上海钢富信息科技有限技有限公司', '上海找油网信息科技', '上海长城实业有限公司',
                        '上海找油网信息科技', '上海长城实业有限公司'
                    ]
                    $("#company input").autocomplete({
                        lookup: data,
                        minChars: 0,
                        appendTo: '#companywrap',
                        onSelect: function(suggestion) {
                            // $(this).val(suggestion.value);
                        },
                    });
                    $("#company1 input").autocomplete({
                        lookup: data,
                        minChars: 0,
                        appendTo: '#companywrap1',
                        onSelect: function(suggestion) {
                            // $(this).val(suggestion.value);
                        },
                    });
                    $("#company2 input").autocomplete({
                        lookup: data,
                        minChars: 0,
                        appendTo: '#companywrap2',
                        onSelect: function(suggestion) {
                            // $(this).val(suggestion.value);
                        },
                    });
                    $("#company3 input").autocomplete({
                        lookup: data,
                        minChars: 0,
                        appendTo: '#companywrap3',
                        onSelect: function(suggestion) {
                            // $(this).val(suggestion.value);
                        },
                    });
                    $("#company4 input").autocomplete({
                        lookup: data,
                        minChars: 0,
                        appendTo: '#companywrap4',
                        onSelect: function(suggestion) {
                            // $(this).val(suggestion.value);
                        },
                    });
                    $("#company5 input").autocomplete({
                        lookup: data,
                        minChars: 0,
                        appendTo: '#companywrap5',
                        onSelect: function(suggestion) {
                            // $(this).val(suggestion.value);
                        },
                    });
                },
                // 表格高度
                getHeight: function() {
                    var _height = $('.form-list').outerHeight(
                        true) + $('.operation').outerHeight(true)
                    return $(window).height() - _height - 20;
                },
            }
            page.init();
        })
    })
    </script>
</body>

</html>